/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template sigFile, choose Tools | Templates
 * and open the template in the editor.
 */
package cn.ac.iie.di.server;

import cn.ac.iie.di.gloabl.GlobalParas;
import cn.ac.iie.di.msg.JsonMsgSender;
import cn.ac.iie.di.tools.JsonSplitor;
import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;

/**
 *
 * @author lenovo-pc
 */
public class GwxFtpParserStartup {

    static Logger logger = null;

    static {
        PropertyConfigurator.configure(ClassLoader.getSystemClassLoader().getResource("log4j.properties"));
        logger = Logger.getLogger(GwxFtpParserStartup.class.getName());
    }

    public static void main(String[] args) {

        startSender();
        startJsonSplitor();
    }

    public static void startSender() {
        Thread threadgmsg = new Thread(new JsonMsgSender());
        threadgmsg.setName("JsonMsgSender");
        threadgmsg.start();
        logger.info("JsonMsgSender start");
    }

    public static void startJsonSplitor() {

        //消息数据队列
        Thread imsgThread = new Thread(new JsonSplitor(GlobalParas.ORI_MSG, GlobalParas.DES_MSG, GlobalParas.FILE_MSG, GlobalParas.msgQueue));
        imsgThread.setName("JsonSplitor" + "_gwx");
        imsgThread.start();
        logger.info("JsonSplitor start");
    }

}
